---
title: "Transform Origin"
description: "Utilities for specifying the origin for an element's transformations."
---

import plugin from 'tailwindcss/lib/plugins/transformOrigin'
import { Variants } from '@/components/Variants'
import { Disabling } from '@/components/Disabling'

export const classes = { plugin }

## Usage

Specify an element's transform origin using the `origin-{keyword}` utilities.

```html indigo
<template preview>
  <div class="flex flex-col justify-around space-y-12 md:flex-row md:space-y-0 md:space-x-12">
    <div class="w-16 h-16 bg-indigo-400 bg-stripes bg-stripes-white">
      <img class="h-16 w-16 origin-center transform rotate-45" src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80">
    </div>
    <div class="w-16 h-16 bg-indigo-400 bg-stripes bg-stripes-white">
      <img class="h-16 w-16 origin-top-left transform rotate-45" src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80">
    </div>
    <div class="w-16 h-16 bg-indigo-400 bg-stripes bg-stripes-white">
      <img class="h-16 w-16 origin-bottom-right transform rotate-45" src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80">
    </div>
    <div class="w-16 h-16 bg-indigo-400 bg-stripes bg-stripes-white">
      <img class="h-16 w-16 origin-left transform rotate-45" src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80">
    </div>
  </div>
</template>

<img class="**origin-center** transform rotate-45 ...">
<img class="**origin-top-left** transform rotate-45 ...">
<img class="**origin-bottom-right** transform rotate-45 ...">
<img class="**origin-left** transform rotate-45 ...">
```

## Responsive

To control the transform-origin of an element at a specific breakpoint, add a `{screen}:` prefix to any existing transform-origin utility. For example, use `md:origin-top` to apply the `origin-top` utility at only medium screen sizes and above.

```html
<img class="origin-center **md:origin-top** ...">
```

For more information about Tailwind's responsive design features, check out the [Responsive Design](/docs/responsive-design) documentation.


## Customizing

### Origin values

By default, Tailwind provides transform-origin utilities for all of the built-in browser keyword options. You change, add, or remove these by customizing the `transformOrigin` section of your Tailwind theme config.

```diff-js
  // tailwind.config.js
  module.exports = {
    theme: {
      extend: {
        transformOrigin: {
+         '24': '6rem',
+         'full': '100%',
        }
      }
    }
  }
```

Learn more about customizing the default theme in the [theme customization documentation](/docs/theme#customizing-the-default-theme).

### Variants

<Variants plugin="transformOrigin" name="transform-origin" />

### Disabling

<Disabling plugin="transformOrigin" name="transform-origin" />
